/*
 * @Author: upp24 1246815351@qq.com
 * @Date: 2023-06-28 10:21:11
 * @LastEditors: alan_mf
 * @LastEditTime: 2024-06-11 17:54:09
 * @FilePath: /nuanyunOA_new/src/api/order.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
export type BannerResult = {
  page: number;
  pagesize: number;
  success: boolean;
  code: number;
  token: string;
  msg: string;
  data: {
    img(img: any): string;
    data: any[];
    total: number;
    page: number;
    pagesize: number;
  };
};
/** 订单列表*/
export const orderList = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("indent/list"), {
    data
  });
};
/** 订单详情*/
export const orderDetail = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("indent/info"), {
    data
  });
};
/** 订单修改*/
export const orderUpdate = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("indent/update"), {
    data
  });
};

/**门店查询 */
export const storeList = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("user/storeList"), {
    data
  });
};

/**一键下单*/
export const orderGo = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("express/create"), {
    data
  });
};

/**订单取消 */
export const orderCancel = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("express/confirm"), {
    data
  });
};

/** 查询团队订单*/
export const teamOrderList = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("user/dunuo"), {
    data
  });
};

/** 查询预约订单*/
export const reOrderList = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("reservation/list"), {
    data
  });
};

/**用户退单 */
export const userRefund = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("indent/chargeback"), {
    data
  });
};

/**发放奖励 */
export const userReward = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("indent/income"), {
    data
  });
};

/**批量 */
export const batchOrder = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("indent/batch"), {
    data
  });
};

/**礼品赠送列表 */
export const giftList = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("size/list"), {
    data
  });
};

/**礼品赠送(修改) */
export const giftUpdate = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("size/update"), {
    data
  });
};
